import 'dart:io';

import 'package:dss_base/dss_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo_test/pages/network/net_a_page.dart';
import 'package:flutter_demo_test/pages/network/net_b_page.dart';
import 'package:flutter_demo_test/pages/network/net_c_page.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class TestPage extends BaseStatelessWidget {
  const TestPage({super.key});

  @override
  Widget onBuild(BuildContext context) {
    return Scaffold(
      appBar: AppBarX(
        title: 'test_long'.tr,
        isBlackBack: false,
        isShowBack: false,
        backgroundColor: Colors.green,
        isBlackStatusFontColor: false,
      ),
      body: ListView(
        children: [
          ElevatedButton(
            onPressed: () => {Get.updateLocale(Locale('zh', 'CN'))},
            child: Text('切换zh-CN', textAlign: TextAlign.center),
          ),
          ElevatedButton(
            onPressed: () => {Get.updateLocale(Locale('en', 'US'))},
            child: Text('切换en-US', textAlign: TextAlign.center),
          ),
          ElevatedButton(
            onPressed: () => NavigatorUtil.push(()=>NetAPage()),
            child: Text('跳转网络a界面'),
          ),
          ElevatedButton(
            onPressed: () => NavigatorUtil.push(()=>NetBPage()),
            child: Text('跳转需要初始化数据网络b界面'),
          ),
          ElevatedButton(
            onPressed: () => NavigatorUtil.push(()=>NetCPage()),
            child: Text('跳转需要初始化数据，可以加载更多网络c界面'),
          ),
          Container(
            width: double.infinity,
            alignment: Alignment.topLeft,
            decoration: BoxDecoration(color: Colors.black),
            child: Column(
              children: [
                Text('data', style: TextStyle(color: Colors.red)),
                Text('data2', style: TextStyle(color: Colors.yellow)),
                Align(
                  alignment: Alignment.centerRight,
                  child: Text('data3', style: TextStyle(color: Colors.yellow)),
                ),
              ],
            ),
          ),
          Wrap(
            children: [
              Text(
                'fafkdasfjaskldfjslakfjasklfjasklfjsakljfklafjkdsajflsafafkdasfjaskldfjslakfjasklfjasklfjsakljfklafjkdsajflsafafkdasfjaskldfjslakfjasklfjasklfjsakljfklafjkdsajflsa',
                style: TextStyle(color: Colors.red),
                softWrap: true,
              ),
            ],
          ),
        ],
      ),
    );
  }
}
